package com.rytx.web.controller.ysp;

import com.rytx.common.core.controller.BaseController;
import com.rytx.system.domain.ysp.ArtOperationDetails;
import com.rytx.system.service.ArtOperationDetailsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/artOperationDetails")
@Api(value = "ArtOperationDetailsController", tags = "艺术操作详情接口")
public class ArtOperationDetailsController extends BaseController {
    @Autowired
    private ArtOperationDetailsService artOperationDetailsService;

    @GetMapping("/{id}")
    @ApiOperation(value = "根据ID获取艺术操作详情", notes = "根据ID获取艺术操作详情")
    public ArtOperationDetails getById(@PathVariable Long id) {
        return artOperationDetailsService.getById(id);
    }

    @GetMapping
    @ApiOperation(value = "获取所有艺术操作详情", notes = "获取所有艺术操作详情")
    public List<ArtOperationDetails> getAll() {
        return artOperationDetailsService.getAll();
    }

    @PostMapping
    @ApiOperation(value = "保存艺术操作详情", notes = "保存艺术操作详情")
    public void save(@RequestBody ArtOperationDetails artOperationDetails) {
        artOperationDetailsService.save(artOperationDetails);
    }

    @PutMapping
    @ApiOperation(value = "更新艺术操作详情", notes = "更新艺术操作详情")
    public void update(@RequestBody ArtOperationDetails artOperationDetails) {
        artOperationDetailsService.update(artOperationDetails);
    }

    @DeleteMapping("/{id}")
    @ApiOperation(value = "删除艺术操作详情", notes = "删除艺术操作详情")
    public void delete(@PathVariable Long id) {
        artOperationDetailsService.delete(id);
    }
}
